<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.ambow.Entity.*"%>
<%@ page import="com.ambow.dao.*"%>
<%@ page import="com.ambow.dao.impl.*"%>
<%@ page import="com.ambow.service.*"%>
<%@ page import="com.ambow.service.impl.*"%>
<%@ page import="com.ambow.utils.*"%>
<%@ page import="com.ambow.servlet.*"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
<meta name="Keywords" content="关键词1,关键词2，关键词3,关键词4,……" />
<meta name="Description" content="你网页的简述" />
<meta name="Robots" content="All" />
<meta name="Generator" content="Dreamweaver" />
<title>菜单管理</title>
<link href="<%=path%>/static/css/css.css" rel="stylesheet"
	type="text/css" />
	<script  type="text/javascript" src="<%=path%>/static/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
	function fillB() {
		var a = document.getElementById("inputA").value;
		var b = document.getElementById("inputB").value;
		if (parseInt(a)>=parseInt(b)) {
			alert("输入的现架位数量大于了原先的值！");
			document().getElementById("inputA").focus();
		} else {
			document.getElementById("inputB").value = parseInt(b) - parseInt(a);
		}

	}
	
	function  sub(){  
	    $.ajax({  
	    type:"GET",  
	    url:"/Book_System/StockMoveServlet",  
	    data:{cellNameto:$("#cellNameto").val(),status:"validat"},  
	    statusCode: {404: function() {  
	         alert('page not found'); }  
	      },      
	    success:function(data,textStatus){ 
	    
	  if(data=="false"){
		  $('#sp').html("该架位不存在！！！");
		  $("#cellNameto").focus();
		  }else if(data=="true"){
			  $('#sp').html("该架位存在,继续输入");
			  }
	     
	      
	    }  
	    });  
	  }
 
</script>

</head>

<body>
	<h3 id="subTitle">教材移库</h3>
	<ul id="button">
		<li><a href="<%=path%>/pages/module/storage/storage005/storage_move_query.jsp">返回</a></li>
	</ul>
	<table width="90%" border="0" align="center" cellpadding="0"
		cellspacing="0" class="table2">
		<form action="StockMoveServlet?status=move" method="post"
			name="form2" id="form2">
			
			<% Stock stock=(Stock)request.getAttribute("stock"); 
			    
			%>
			<tr>
				<td width="20%" nowrap="nowrap" align="right">教材名称：</td>
				<td nowrap="nowrap" colspan=3><input name="textBookName"
					type="text" class="input2"
					value="<%=stock.getTextBook().getName() %>" /></td>

			</tr>
			
			<tr>
				<td width="20%" nowrap="nowrap" align="right">原架位：</td>
				<td nowrap="nowrap"><input name="cellName" type="text"
					class="input2" value="<%=stock.getCell().getName() %>" />
					<td width="20%" nowrap="nowrap" align="right">原架位数量：</td>
					<td nowrap="nowrap"><input id="inputB" name="amount"
						type="text" class="input2" value="<%=stock.getAmount() %>"
						onkeyup="fillB()" />
						
			</tr>
			<tr>
				<td width="20%" nowrap="nowrap" align="right">现架位：</td>
				<td nowrap="nowrap"><input id="cellNameto" name="cellNameto" onblur="sub()"
					type="text" class="input2"   /><br/>
					 <span id="sp"></span> 
					<td width="20%" nowrap="nowrap" align="right">现架位数量：</td>
					<td nowrap="nowrap"><input id="inputA" name="toAmount"
						type="text" class="input2" onblur="fillB() "/>
						 
			</tr>


		
			<tr>
				<td>&nbsp;</td>
				<td colspan=3><input name="Submit" type="submit"
					class="buttonInp" value="提 交" /></td>
			</tr>

		</form>
	</table>
	<p>&nbsp;</p>
	&nbsp;&nbsp;注:教材名称、原架位和原架位数量不需要用户输入.
	<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用JS验证书架是否存在
	 

</body>
</html>
